package com.cl.entity;

import java.io.Serializable;

import javax.persistence.*;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.cl.entity.common.DBObject;

import java.math.BigDecimal;
import java.util.Date;


/**
 * The persistent class for the U_USER database table.
 * 
 */
@Entity
@Table(name="U_USER")
public class UUser implements Serializable,DBObject {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long id;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DT_CREATE")
	private Date dtCreate;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DT_MODIFY")
	private Date dtModify;

	private String duty;

	private String email;

	@ManyToOne(cascade={CascadeType.REFRESH,CascadeType.MERGE, CascadeType.PERSIST})//UUser是关系的维护端
	@JoinColumn(insertable=false, updatable=false,name="gid")//指定外键的名称
	@Fetch(FetchMode.JOIN)//会使用left join查询,只产生一条语句
	private UGroup ugroup;
	
	
	public UGroup getUgroup() {
		return ugroup;
	}

	@Column(name="gid")	
	private BigDecimal	gid;
	
	public void setUgroup(UGroup ugroup) {
		this.ugroup = ugroup;
	}

	private String msn;

	private String name;

	private String phone;

	private String pwd;

	private String qq;

	private String remark;

	private BigDecimal status;

	private String tel;

	@Column(name="USER_ID")
	private String userId;

	private String weibo;

	@Column(name="IDENTIFICATION_UNIT")
	private String identificationUnit;

	private Integer version;

	@Column(name="ORG_ID")
	private String orgId;

	@Column(name="ORG_NAME")
	private String orgName;

	@Column(name="OFFICE_NAME")
	private String officeName;

	private String userdn;

	private String sex;

	private String corp;

	public UUser() {
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

//	public String getAvatar() {
//		return this.avatar;
//	}
//
//	public void setAvatar(String avatar) {
//		this.avatar = avatar;
//	}

//	public BigDecimal getDid() {
//		return this.did;
//	}
//
//	public void setDid(BigDecimal did) {
//		this.did = did;
//	}

//	public String getDpt() {
//		return this.dpt;
//	}
//
//	public void setDpt(String dpt) {
//		this.dpt = dpt;
//	}

	public Date getDtCreate() {
		return this.dtCreate;
	}

	public void setDtCreate(Date dtCreate) {
		this.dtCreate = dtCreate;
	}

	public Date getDtModify() {
		return this.dtModify;
	}

	public void setDtModify(Date dtModify) {
		this.dtModify = dtModify;
	}

	public String getDuty() {
		return this.duty;
	}

	public void setDuty(String duty) {
		this.duty = duty;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public BigDecimal getGid() {
		return this.gid;
	}

	public void setGid(BigDecimal gid) {
		this.gid = gid;
	}

	public String getMsn() {
		return this.msn;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPwd() {
		return this.pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String getQq() {
		return this.qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public BigDecimal getStatus() {
		return this.status;
	}

	public void setStatus(BigDecimal status) {
		this.status = status;
	}

	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getWeibo() {
		return this.weibo;
	}

	public void setWeibo(String weibo) {
		this.weibo = weibo;
	}

	@Override
	public Long getPrimaryId() {
		return this.id;
	}

	@Override
	public void setDcCreate(Date dcCreate) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Date getDcCreate() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void setLastUpdate(Date lastUpdate) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Date getLastUpdate() {
		// TODO Auto-generated method stub
		return null;
	}
	
	public void setDcEditor0(String dcEditor0) {
		// TODO Auto-generated method stub
		
	}

	public String getDcEditor0() {
		// TODO Auto-generated method stub
		return null;
	}

	public String getSalt() {
		// TODO Auto-generated method stub
		return "salt";
	}

	public String getIdentificationUnit() {
		return identificationUnit;
	}

	public void setIdentificationUnit(String identificationUnit) {
		this.identificationUnit = identificationUnit;
	}

	public String getCorp() {
		return corp;
	}

	public void setCorp(String corp) {
		this.corp = corp;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	public String getUserdn() {
		return userdn;
	}

	public void setUserdn(String userdn) {
		this.userdn = userdn;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getOfficeName() {
		return officeName;
	}

	public void setOfficeName(String officeName) {
		this.officeName = officeName;
	}

}